public class MyThread extends Thread{
    @Override
    public void run() {
        for(int i = 0; i < 5; i++){
            System.out.println(i);
            try {
                Thread.currentThread().sleep(100);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }

    public static void main(String[] args) {
        MyThread t = new MyThread();
        t.start();
        System.out.println("One:");
        MyThread s = new MyThread();
        s.start();
        System.out.println("Two.");
    }
}
